package org.huntaway.kindergarten.service.bi.funds;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.huntaway.kindergarten.manager.IncomeMng;
import org.huntaway.kindergarten.po.FinanceType;
import org.huntaway.kindergarten.po.InDefine;
import org.huntaway.kindergarten.po.Income;
import org.huntaway.kindergarten.service.KindProcessor;
import org.huntaway.kindergarten.util.GlobalCon;

public class IncomeService extends KindProcessor<Income> {
	public IncomeService() {
		super();
		baseMng = (IncomeMng) sm.getMng(GlobalCon.INCOME);
	}
	public ActionForward addBegin(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ActionForward serBean = super.addBegin(mapping, form, request, response);
		request.setAttribute("inLst", dateManage.findbyhql("from InDefine")
				.list());
		request.setAttribute("auLst", dateManage.findbyhql("from SysUser where Userstat=0")
				.list());
		return serBean;
	}

	public ActionForward addProcess(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ActionForward serBean = super
				.addProcess(mapping, form, request, response);	
		return serBean;
	}
	public ActionForward editBegin(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		ActionForward serBean = super.editBegin(mapping, form, request, response);
		request.setAttribute("inLst", dateManage.findbyhql("from InDefine")
				.list());
		request.setAttribute("auLst", dateManage.findbyhql("from SysUser where Userstat=0")
				.list());
		return serBean;
	}
	@Override
	public Income getObj() {
		return new Income();
	}
}
